package com.yl.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yl.model.Address;
import com.yl.model.Category;
import com.yl.service.ICategoryService;
@ResponseBody
@Controller
public class CategoryController {

	
	@Resource
	private ICategoryService categoryService;
	//显示商品分类
	@RequestMapping("/findAllcategory.do")
	public Map findAll() {
		return categoryService.findAll();
	}
	//根据id删除分类
	@RequestMapping("/delcategory.do")
	public int del(int category_id) {
		return categoryService.del(category_id);
	}
	//新增分类
	@RequestMapping("/addcategory.do")
	public int add(Category category) {
		return categoryService.add(category);
	}
	//显示推荐商品
	@RequestMapping("/findAllstate.do")
	public Map findAllstate() {
		return categoryService.findAllstate();
	}
	//编辑分类
	@RequestMapping("/editcategory.do")
	public int edit(Category category) {
		return categoryService.edit(category);
	}
}
